<?PHP

	// =======================================================================================
	// = WARNING: Changing HTML classes and ids will probably break JavaScript functionality =
	// =======================================================================================

if(count($feature_content) > 0){
	
	echo $this->values['before_title'].$title.$this->values['after_title'];
	
?>

<div class="op_tabbed_content">

<?PHP if(count($feature_content) > 1){ ?>
	<div id="op_tabbed_tabs-<?PHP echo $this->values['number'] ?>" class="op_tabbed_tabs">
		<ul>
			<?PHP 
		
			// Loop through each tab
			for($i=0; $i < count($feature_content); $i++){
				$selected = $i==0 ? ' selected' : ''; // Initialize widget with first tab selected
				$tab_class = $i+1; // i.e. tabbed_tab-1


// Output until EOS;
echo <<<EOS
<li class="tabbed_tab-$tab_class{$selected}"><a href="#" onclick="return false" title="{$feature_content[$i]['name']}">{$feature_content[$i]['name']}</a></li>
EOS;
// ATTN -- do not move line above this: "EOS;"


			} // End loop through each tab
			
			?>
		</ul>
	</div>
<?PHP } ?>
	<div id="op_tabbed_datasets-<?PHP echo $this->values['number'] ?>" class="op_tabbed_datasets">
		<span class="forclear"></span>
		<?PHP
		
		// Loop through each tab
		for($i=0; $i<count($feature_content); $i++){
			$dataset_class = $i+1; // i.e. tabbed_dataset-1
			$classextra = $i == 0 ? '' : ' hide'; // initalize widget with all hidden except first tab

echo <<<EOS
<div class="tabbed_dataset-$dataset_class{$classextra}">
EOS;

			echo $feature_content[$i]['content'];
				
echo '</div>';
		} // End loop through each tab
	?>
	</div>
	<span class="forclear"></span>
</div>

<?PHP echo $values['after_widget'];
	}
?>